package org.smart4j.aopdemo.spring;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.stereotype.Component;


@Component
public class GreetingAroundAdvice implements MethodInterceptor {
    public Object invoke(MethodInvocation invocation) throws Throwable {
        before();
        Object result = invocation.proceed();
        after();
        return result;
    }


    public void before() {
        System.out.println(" before");
    }

    public void after() {
        System.out.println(" after");
    }
}
